﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="job_edit.aspx.cs" Inherits="vdos.jobseeker.AdminCP.Job.job_edit" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" >
        var $j = jQuery.noConflict(); //set no conflict so you can use with MS AJAX.
        $j(document).ready(function () {
            $j("#<%=JobPostDate.ClientID %>").datepicker();
            $j("#<%=JobDeadlineToApply.ClientID %>").datepicker();
        });



        $(function () {
            var warning = $(".cities");
            var warning2 = $(".industries");

            $("#<%=JobCities.ClientID %>").multiselect({
                selectedList: 3,
                click: function (e) {

                    if ($(this).multiselect("widget").find("input:checked").length > 3) {
                        warning.addClass("error").removeClass("success").html("Bạn chỉ được chọn tối đa 3 nơi làm việc");
                        return false;
                    } else {
                        warning.addClass("success").removeClass("error").html("Tối đa 3 địa điểm.");
                    }

                },
                close: function (e) {
                    var array_of_checked_values = $("#<%=JobCities.ClientID %>").multiselect("getChecked").map(function () {
                        return this.value;
                    }).get();
                    //alert(array_of_checked_values);
                    $("#<%=aJobCities.ClientID %>").val(array_of_checked_values);
                    //alert($("#<%=aJobCities.ClientID %>").val());
                },
                create: function (e) {
                    var valArr = $("#<%=aJobCities.ClientID %>").val().split(',');
                    i = 0, size = valArr.length;
                    for (i; i < size; i++) {
                        $("#<%=JobCities.ClientID %>").multiselect("widget").find(":checkbox[value='" + valArr[i] + "']").attr("checked", "checked");
                        $("#<%=JobCities.ClientID %> option[value='" + valArr[i] + "']").attr("selected", 1);
                        $("#<%=JobCities.ClientID %>").multiselect("refresh");
                    }
                }

            });




            // Industries
            $("#<%=JobIndustries.ClientID %>").multiselect({
                selectedList: 3,
                click: function (e) {

                    if ($(this).multiselect("widget").find("input:checked").length > 3) {
                        warning2.addClass("error").removeClass("success").html("Bạn chỉ được chọn tối đa 3 ngành nghề");
                        return false;
                    } else {
                        warning2.addClass("success").removeClass("error").html("Tối đa 3 ngành nghề.");
                    }

                },
                close: function (e) {
                    var array_of_checked_values = $("#<%=JobIndustries.ClientID %>").multiselect("getChecked").map(function () {
                        return this.value;
                    }).get();
                    //alert(array_of_checked_values);
                    $("#<%=aJobIndustries.ClientID %>").val(array_of_checked_values);
                },

                create: function (e) {
                    var valArr = $("#<%=aJobIndustries.ClientID %>").val().split(',');
                    i = 0, size = valArr.length;
                    for (i; i < size; i++) {
                        $("#<%=JobIndustries.ClientID %>").multiselect("widget").find(":checkbox[value='" + valArr[i] + "']").attr("checked", "checked");
                        $("#<%=JobIndustries.ClientID %> option[value='" + valArr[i] + "']").attr("selected", 1);
                        $("#<%=JobIndustries.ClientID %>").multiselect("refresh");
                    }
                }

            });

        });

        
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <section id="content">
  <section class="container_12 clearfix">
    <section id="main" class="grid_12">
      <article>
        <div class="h1">Sửa tin, bài</div>
          <dl class="inline">
            <dt>
              <label >Công ty:</label>
            </dt>
            <dd>
             <asp:DropDownList ID="CompanyID" runat="server" CssClass="medium"></asp:DropDownList>
            </dd>
            <dt>
              <label >Chức danh công việc:</label>
            </dt>
            <dd>
              <input type="text"   class="big" id="JobPosition" runat="server" />
            </dd>
            <dt><label >Mô tả công việc:</label> </dt>
            <dd>
            <FCKeditorV2:FCKeditor ID="JobDescription" runat="server" BasePath="~/fckeditor/" Height="300px" >
                </FCKeditorV2:FCKeditor>
            </dd>
             <dt>
              <label >Yêu cầu công việc:</label>
            </dt>
            <dd>
              <FCKeditorV2:FCKeditor ID="JobRequire" runat="server" BasePath="~/fckeditor/" Height="300px" >
                </FCKeditorV2:FCKeditor>
            </dd>
            <dt>
              <label >Cấp bậc:</label>
            </dt>
            <dd>
             <asp:DropDownList ID="JobLevel" runat="server" CssClass="medium"></asp:DropDownList>
            </dd>
            <dt>
              <label >Nghề nghiệp:</label>
            </dt>
            <dd>
            <p class="message success industries">Tối đa 3 ngành nghề.</p>
             <asp:DropDownList ID="JobIndustries" runat="server" CssClass="medium"></asp:DropDownList>
             <input type="hidden" class="medium"  id="aJobIndustries"  runat="server" /> 
            </dd>
            <dt>
              <label >Nơi làm việc:</label>
            </dt>
            <dd>
            <p class="message success cities">Tối đa 3 địa điểm.</p>
             <asp:DropDownList ID="JobCities" runat="server" CssClass="medium"></asp:DropDownList>
             <input type="hidden" class="medium"  id="aJobCities"  runat="server" /> 
            </dd>
            <dt><label>Mức lương:</label></dt>
            <dd>
            <input type="text" class="medium"  id="JobSalaryLevel" runat="server" /> 
            </dd>
            <dt><label>Loại hình công việc:</label></dt>
            <dd>
            <input type="text" class="medium"  id="JobType" runat="server" /> 
            </dd>
            <dt>
              <label >Ngày đăng:</label>
            </dt>
            <dd>
              <input type="text" class="medium" id="JobPostDate" runat="server" />
            </dd>
           <dt>
              <label >Ngày hết hạn:</label>
            </dt>
            <dd>
              <input type="text" class="medium" id="JobDeadlineToApply" runat="server" />
            </dd>
            <dt>
              <label >Việc làm tốt nhất:</label>
            </dt>
            <dd>
              <asp:CheckBox ID="JobHot" runat="server" />
            </dd>
          </dl>
          <p>
          
          <asp:Button class="button big" style="width:auto;" Text="Cập nhật tin, bài" ID="btnUpdate" runat="server" 
                  onclick="btnUpdate_Click"  />
          </p>
       
      </article>
    </section>
  </section>
</section>
</asp:Content>
